const express = require('express');

const app = express();

app.use((request, response, next)=>{
    response.setHeader('Access-Control-Allow-Origin','*');
    next();
})

app.get('/server', (request, response)=>{
    response.json({
        code:0,
        msg:'成功'
    })
})
app.get('/timeout', (request, response)=>{
    setTimeout(()=>{
        response.json({
            code:0,
            msg:'成功'
        })
    },3000);
})
app.listen(8000,()=>{
    console.log('server run at 8000');
})